package com.unei.guava.demo.fp;

import com.google.common.base.Function;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Function
 * A good Function implementation should have no side effects,meaning the object
 * passed as an argument should remain unchanged after the apply method has been called.
 */
public class DateFormatFunction implements Function<Date,String> {
    @Override
    public String apply(Date input) {
        SimpleDateFormat format=new SimpleDateFormat("dd/mm/yyyy");
        return format.format(input);
    }
}
